ci: bind the no-mistakes attestation to the current PR head - #161
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
The attestation gate parsed the
no-mistakes-pipeline-attestation:v1payload'shead_shaand printed it, but never compared it to the PR's current head. Acommit pushed directly after a no-mistakes run therefore passed the gate on a
stale attestation that described different code.
This ports the head binding that landed on
lavish-aximain (PR #271):PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}added to the gatestep's
env:.head_shais present, the PR head sha is present, and the two are equal. On mismatch it
emits an
::error::naming both shas and telling the author to re-rungit push no-mistakes.head_shaand on an absentPR_HEAD_SHA.A
synchronizeevent whose PR body was not rewritten by no-mistakes now goesred. That is the attestation contract, not a false positive.
This repo's
paths-ignore, author exemptions,if:condition, and job name areunchanged. The gate
run:script is byte-identical tolavish-aximain's.Tests
Four regression cases added to
test/no-mistakes-gate.test.mjs, mirroringlavish's and adapted to this repo's
describe/it+ YAML-parse extraction:matching head passes, stale head fails, missing
head_shafails closed, missingPR_HEAD_SHAfails closed.pnpm run test:workflows
lint / format:check / docs:check
Note
This PR was raised directly, not through
git push no-mistakes, so the advisoryRequire no-mistakescheck will fail on it by design. The real checks (build,test, guard-generated-files) are the ones to read.